#include "my_label.h"

My_label::My_label(const QString &title, QWidget *parent) : QWidget(parent)
{
    this->lab_title = new QLabel(this);
    this->lab_value = new QLabel(this);
    this->lab_title->setAlignment(Qt::AlignCenter);
    this->lab_value->setAlignment(Qt::AlignCenter);
    this->box = new QHBoxLayout();
    box->addWidget(lab_title);
    box->addWidget(lab_value);
    box->setContentsMargins(LEFT_M, TOP_M, RIGHT_M, BOTTOM_M);
    box->setSpacing(SPACE_SON);
    setLayout(box);
    lab_title->setText(title);
}

void My_label::set_text(const QString &text)
{
    this->lab_value->setText(text);
}

void My_label::set_num(double num)
{
    this->lab_value->setNum(num);
}
